package com.madou.dbtool.mysql.test;

import com.madou.bean.BeanFactory;
import com.madou.dbtool.common.icon.AllIcons;
import com.madou.dbtool.common.messages.DBToolBundle;
import com.madou.dbtool.constans.Constans;
import com.madou.dbtool.relationship.jcef.web.WebViewPanel;
import com.madou.dbtool.relationship.node.menu.NodeMenuFactory;
import com.madou.dbtool.relationship.sql.SqlPasrer;
import com.madou.dbtool.relationship.sql.SqlPasrerFactory;
import com.madou.inters.util.MessageUtil;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.Map;

/*
 * @author miukoo
 * @description //TODO
 * @date 2023/7/23 13:53
 * @version 1.0
 **/
public class MysqlWebFrame extends JFrame {

    public MysqlWebFrame(){
        Constans.PARENT_COMPONENT = this;
        BeanFactory.getInstance().getBean(MessageUtil.class).setComponent(this);
        // todo 初始化
        Map<String, SqlPasrer> pasrers = SqlPasrerFactory.PASRERS;
        NodeMenuFactory.getMenuList(new ArrayList<>());
    }

    public static void main(String[] args) {
        MysqlWebFrame dbToolFrame = new MysqlWebFrame();
        dbToolFrame.setTitle("1919");
        dbToolFrame.setSize(new Dimension(500,500));
        dbToolFrame.setPreferredSize(new Dimension(500,500));
        dbToolFrame.setTitle(DBToolBundle.message("mysql.title"));
        dbToolFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        dbToolFrame.setIconImage(AllIcons.Windows.MYSQL_ICON);
        dbToolFrame.setVisible(true);
        dbToolFrame.pack();
        dbToolFrame.add(new WebViewPanel("http://localhost:5173/"));

    }

}
